Skip to content

[PropertyInfo] Deprecate Type#20821

Open
MrYamous wants to merge 5 commits intosymfony:7.3from
MrYamous:property-info/deprecate-type
Open

[PropertyInfo] Deprecate Type#20821
MrYamous wants to merge 5 commits intosymfony:7.3from
MrYamous:property-info/deprecate-type

Conversation

@MrYamous
Copy link
Copy Markdown
Contributor

Fixes #20799

Comment thread components/property_info.rst Outdated
Comment thread components/property_info.rst Outdated
@OskarStark
Copy link
Copy Markdown
Contributor

friendly ping @mtarld

Comment thread components/property_info.rst Outdated
Comment thread components/property_info.rst Outdated

.. _`components-property-info-type-builtin`:

``Type::getBuiltInType()``
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these methods are kind of removed:

  • getBuiltinType is the same as getTypeIdentifier of BuiltinType and ObjectType
  • isNullable still exists
  • getClassName only exists on ObjectType
  • isCollection is the equivalent of $type instanceof CollectionType
  • getCollection[Key|Value]Types is the same as getCollection[Key|Value]Type of CollectionType

The Type of TypeInfo is really different from the one from PropertyInfo, so I think we might rewrite that part completely.

Or maybe redirect to the doc related to TypeInfo's Type?

Copy link
Copy Markdown
Contributor Author

@MrYamous MrYamous Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I missed those differences.
Maybe we can remove this part from PropertyInfo Type doc as the class is deprecated and update TypeInfo doc with appropriate methods ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also not mix the TypeInfo things into the doc of PropertyInfo

Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
Co-authored-by: Mathias Arlaud <mathias.arlaud@gmail.com>
Comment thread components/property_info.rst Outdated
Comment on lines +172 to +177
private $builtinType => string(6) "string"
private $nullable => bool(false)
private $class => NULL
private $collection => bool(false)
private $collectionKeyType => NULL
private $collectionValueType => NULL
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not what the Type class (from type-info) contains.

@javiereguiluz
Copy link
Copy Markdown
Member

@MrYamous will you have time to finsih this? Thanks!

@MrYamous
Copy link
Copy Markdown
Contributor Author

@MrYamous will you have time to finsih this? Thanks!

On my way

Comment on lines +171 to +176
NullableType {
- type: BuiltinType(string)
- types: [
BuiltinType(null),
BuiltinType(string),
]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about how to represent this in documentation

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PropertyInfo] Deprecate Type

5 participants